home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
201-225
/
disk_222
/
plplot
/
src
/
source.zoo
/
plgrid3.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-15
|
3KB
|
97 lines
/* Routine to draw a grid around the back side of the 3d plot */
/* wih hidden line removal */
#include "plplot.h"
#include <math.h>
void plgrid3(tick)
float tick;
{
float xmin, ymin, zmin, xmax, ymax, zmax, zscale;
float cxx, cxy, cyx, cyy, cyz;
int u[3], v[3];
int nsub, mode, prec;
float tp;
gw3wc(&cxx,&cxy,&cyx,&cyy,&cyz);
gdom(&xmin,&xmax,&ymin,&ymax);
grange(&zscale,&zmin,&zmax);
nsub = 0;
pldtik(zmin,zmax,&tick,&nsub,&mode,&prec);
tp = tick * floor(zmin/tick) + tick;
if (cxx >= 0.0 && cxy <= 0.0) {
while ( tp <= zmax ) {
u[0] = wcpcx(w3wcx(xmin,ymax,tp));
v[0] = wcpcy(w3wcy(xmin,ymax,tp));
u[1] = wcpcx(w3wcx(xmax,ymax,tp));
v[1] = wcpcy(w3wcy(xmax,ymax,tp));
u[2] = wcpcx(w3wcx(xmax,ymin,tp));
v[2] = wcpcy(w3wcy(xmax,ymin,tp));
plnxtv(u,v,3,2);
tp += tick;
}
u[0] = wcpcx(w3wcx(xmax,ymax,zmin));
v[0] = wcpcy(w3wcy(xmax,ymax,zmin));
u[1] = wcpcx(w3wcx(xmax,ymax,zmax));
v[1] = wcpcy(w3wcy(xmax,ymax,zmax));
plnxtv(u,v,2,2);
}
else if(cxx <= 0.0 && cxy <= 0.0) {
while ( tp <= zmax ) {
u[0] = wcpcx(w3wcx(xmax,ymax,tp));
v[0] = wcpcy(w3wcy(xmax,ymax,tp));
u[1] = wcpcx(w3wcx(xmax,ymin,tp));
v[1] = wcpcy(w3wcy(xmax,ymin,tp));
u[2] = wcpcx(w3wcx(xmin,ymin,tp));
v[2] = wcpcy(w3wcy(xmin,ymin,tp));
plnxtv(u,v,3,2);
tp += tick;
}
u[0] = wcpcx(w3wcx(xmax,ymin,zmin));
v[0] = wcpcy(w3wcy(xmax,ymin,zmin));
u[1] = wcpcx(w3wcx(xmax,ymin,zmax));
v[1] = wcpcy(w3wcy(xmax,ymin,zmax));
plnxtv(u,v,2,2);
}
else if(cxx <= 0.0 && cxy >= 0.0) {
while ( tp <= zmax ) {
u[0] = wcpcx(w3wcx(xmax,ymin,tp));
v[0] = wcpcy(w3wcy(xmax,ymin,tp));
u[1] = wcpcx(w3wcx(xmin,ymin,tp));
v[1] = wcpcy(w3wcy(xmin,ymin,tp));
u[2] = wcpcx(w3wcx(xmin,ymax,tp));
v[2] = wcpcy(w3wcy(xmin,ymax,tp));
plnxtv(u,v,3,2);
tp += tick;
}
u[0] = wcpcx(w3wcx(xmin,ymin,zmin));
v[0] = wcpcy(w3wcy(xmin,ymin,zmin));
u[1] = wcpcx(w3wcx(xmin,ymin,zmax));
v[1] = wcpcy(w3wcy(xmin,ymin,zmax));
plnxtv(u,v,2,2);
}
else if(cxx >= 0.0 && cxy >= 0.0) {
while ( tp <= zmax ) {
u[0] = wcpcx(w3wcx(xmin,ymin,tp));
v[0] = wcpcy(w3wcy(xmin,ymin,tp));
u[1] = wcpcx(w3wcx(xmin,ymax,tp));
v[1] = wcpcy(w3wcy(xmin,ymax,tp));
u[2] = wcpcx(w3wcx(xmax,ymax,tp));
v[2] = wcpcy(w3wcy(xmax,ymax,tp));
plnxtv(u,v,3,2);
tp += tick;
}
u[0] = wcpcx(w3wcx(xmin,ymax,zmin));
v[0] = wcpcy(w3wcy(xmin,ymax,zmin));
u[1] = wcpcx(w3wcx(xmin,ymax,zmax));
v[1] = wcpcy(w3wcy(xmin,ymax,zmax));
plnxtv(u,v,2,2);
}
}